<template>
  <RouterView></RouterView>
  <van-tabbar route active-color="#C90000" v-if="isShow">
  <van-tabbar-item replace to="/" icon="home-o">首页</van-tabbar-item>
  <van-tabbar-item replace to="/list" icon="apps-o">分类</van-tabbar-item>
  <van-tabbar-item replace to="/cart" icon="shopping-cart-o">购物车</van-tabbar-item>
  <van-tabbar-item replace to="/my" icon="contact-o">我的</van-tabbar-item>
</van-tabbar>
</template>
<script setup>
import { ref,watch } from "vue";
import { useRouter} from 'vue-router'
const router = useRouter()
const active = ref(0);
let isShow=ref(true)
watch(
  () => router.currentRoute.value,
  (newValue) => {
    let arr=['/home','/list','/cart','/my',"/search"]

    if(arr.includes(newValue.path)){
     isShow.value=true
    }else{
     isShow.value=false
    }
     
  },
  { immediate: true }
)







</script>



<style lang="scss">
.van-tabbar{
  background-color: aqua;
}
</style>
